﻿/// <reference path="admin-common.js" />   
/// <reference path="../../Common/Scripts/jquery.min.js" />
/// <reference path="~/Content/Common/Widget/kindeditor/kindeditor-min.js" />

var CategoryTypeData = [{ "id": "1010", "text": "学历", "selected": false }, { "id": "1013", "text": "岗位", "selected": false }, { "id": "1015", "text": "产品", "selected": false }, { "id": "1018", "text": "视频", "selected": false }, { "id": "1019", "text": "文章", "selected": false }, { "id": "1020", "text": "性别", "selected": false }, { "id": "1050", "text": "系统语言", "selected": false }, { "id": "1080", "text": "工作类型", "selected": false }, { "id": "1090", "text": "工作经验", "selected": false }, { "id": "2000", "text": "应聘方式", "selected": false }, { "id": "2010", "text": "工作地点", "selected": false }, { "id": "2020", "text": "面试语言", "selected": false }, { "id": "2030", "text": "考核方式", "selected": false }, { "id": "2040", "text": "广告图片", "selected": false}];
var ProductCategoryData;

/*页面构建*/

$(document).ready(function () {
    /*主窗体初始化*/
    MainInit();
    /*管理员登出*/
    $('#loginOut').click(function () {
        LoginOut();
    });
    /**/
    $("#tabs-menu-a-news").click(function () {
        NewsTabs(this);
    });
    /**/
    $("#tabs-menu-a-technologyconsulting").click(function () {
        TechnologyConsultingTabs(this);
    });
    /**/
    $("#tabs-menu-a-link").click(function () {
        LinkTabs(this);
    });
    /**/
    $("#tabs-menu-a-product").click(function () {
        ProductTabs(this);
    });
    /**/
    $("#tabs-menu-a-product-create").click(function () {
        ProductCreateWindows(ProductTable);
    });
    /**/
    $("#tabs-menu-a-setting-site").click(function () {
        SettingSiteTabs(this);
    });
    /**/
    $("#tabs-menu-a-modify-password").click(function () {
        ModifyPasswordPageTabs(this);
    });
    /**/
    $("#tabs-menu-a-recruitment").click(function () {
        RecruitmentTabs(this);
    });
    /**/
    $("#tabs-menu-a-candidates").click(function () {
        CandidatesTabs(this);
    });
    /**/
    $("#tabs-menu-a-contactus").click(function () {
        SettingContactUsTabs(this);
    });
    /**/
    $("#tabs-menu-a-network").click(function () {
        SettingSalesNetworkTabs(this);
    });
    /**/
    $("#tabs-menu-a-video").click(function () {
        SettingVideoTabs(this);
    });
    /**/
    $("#tabs-menu-a-category").click(function () {
        CategoryTabs(this);
    });
    $("#tabs-menu-a-category-product").click(function () {
        CategoryProductTabs(this);
    });
    /**/
    $("#tabs-menu-a-about").click(function () {
        SettingAboutTabs(this);
    });
    /**/
    $("#tabs-menu-a-news-create").click(function () {
        NewsCreateWindows(NewsTable);
    });
    /**/
    $("#tabs-menu-a-technologyconsulting-create").click(function () {
        TechnologyConsultingCreateWindows(TechnologyConsultingTable);
    });
    /**/
    $("#tabs-menu-a-recruitment-create").click(function () {
        RecruitmentCreateWindow(RecruitmentTable);
    });
    /**/
    $("#tabs-menu-a-category-create").click(function () {
        CategoryCreateWindows(CategoryTable);
    });
    $("#tabs-menu-a-category-product-create").click(function () {
        CategoryProductCreateWindows(ProductCategoryTable);
    });
    /**/
    $("#tabs-menu-a-link-create").click(function () {
        LinkCreateWindows(LinkTable);
    });
    LoadProductCategoryData();
});

/*主窗体初始化*/
var MainInit = function () {
    $('body').append("<div id=\"win-create-news\" iconCls=\"icon-add\" title=\"添加新闻\"> </div>");
    $('body').append("<div id=\"win-edit-news\" iconCls=\"icon-edit\" title=\"修改新闻\"> </div>");
    $('body').append("<div id=\"win-search-news\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-create-technologyconsulting\" iconCls=\"icon-add\" title=\"添加技术文章\"> </div>");
    $('body').append("<div id=\"win-edit-technologyconsulting\" iconCls=\"icon-edit\" title=\"修改技术文章\"> </div>");
    $('body').append("<div id=\"win-search-technologyconsulting\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-product\" iconCls=\"icon-edit\" title=\"编辑产品\"> </div>");
    $('body').append("<div id=\"win-create-product\" iconCls=\"icon-add\" title=\"添加产品\"> </div>");
    $('body').append("<div id=\"win-search-product\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-advertisement\" iconCls=\"icon-edit\" title=\"编辑广告\"> </div>");
    $('body').append("<div id=\"win-create-advertisement\" iconCls=\"icon-add\" title=\"添加广告\"> </div>");
    $('body').append("<div id=\"win-search-advertisement\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-link\" iconCls=\"icon-edit\" title=\"编辑友情链接\"> </div>");
    $('body').append("<div id=\"win-create-link\" iconCls=\"icon-add\" title=\"添加友情链接\"> </div>");
    $('body').append("<div id=\"win-search-link\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-recruitment\" iconCls=\"icon-edit\" title=\"编辑招聘信息\"> </div>");
    $('body').append("<div id=\"win-create-recruitment\" iconCls=\"icon-add\" title=\"添加招聘信息\"> </div>");
    $('body').append("<div id=\"win-search-recruitment\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-details-candidates\" iconCls=\"icon-search\" title=\"查看应聘信息\"> </div>");
    $('body').append("<div id=\"win-edit-candidates\" iconCls=\"icon-edit\" title=\"编辑应聘信息\"> </div>");
    $('body').append("<div id=\"win-create-candidates\" iconCls=\"icon-add\" title=\"添加招聘信息\"> </div>");
    $('body').append("<div id=\"win-search-candidates\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-order\" iconCls=\"icon-edit\" title=\"编辑订单信息\"> </div>");
    $('body').append("<div id=\"win-create-order\" iconCls=\"icon-add\" title=\"添加订单信息\"> </div>");
    $('body').append("<div id=\"win-search-order\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

    $('body').append("<div id=\"win-edit-category\" iconCls=\"icon-edit\" title=\"编辑分类\"> </div>");
    $('body').append("<div id=\"win-create-category\" iconCls=\"icon-add\" title=\"添加分类\"> </div>");
    $('body').append("<div id=\"win-search-category\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");
    $('body').append("<div id=\"win-edit-product-category\" iconCls=\"icon-edit\" title=\"编辑产品分类\"> </div>");
    $('body').append("<div id=\"win-create-product-category\" iconCls=\"icon-add\" title=\"添加产品分类\"> </div>");
    $('body').append("<div id=\"win-search-product-category\" iconCls=\"icon-search\" title=\"查询条件\"> </div>");

};

var LoadCategoryTypeData = function () {

    $.ajax({
        url: '/admin/Category/GetCategoryType',
        dataType: 'json',
        type: 'post',
        async: false,
        success: function (data) {
            CategoryTypeData = data;
        }
    });

};

var LoadProductCategoryData = function () {

    $.ajax({
        url: '/admin/Category/GetProductComboBoxJson',
        dataType: 'json',
        type: 'post',
        async: false,
        success: function (data) {
            ProductCategoryData = data;
        }
    });
};

var FileDelete = function (id) {
    $.ajax({
        type: "POST",
        url: '/admin/Attachment/Delete',
        data: { id: id },
        success: function (msg) {
            AjaxMessage(msg);
        },
        error: function () {
            $.messager.alert('错误', '删除失败！', "error");
        }
    });
};
var DeleteProductImage = function (id) {
    $.ajax({
        type: "POST",
        url: '/admin/Attachment/DeleteProductImage',
        data: { id: id },
        success: function (msg) {

        },
        error: function () {

        }
    });
};
/*站点设置*/
var SettingSiteTabs = function (th) {
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingSitePageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingSitePostUrl = "/admin/setting/Site";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {


        var cultureCombobox = $('#setting-site-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-site').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingSitePostUrl = "/admin/setting/Site/" + record.id;
            }
        });
        $('#setting-site-culture').combobox("setValue", $('#setting-site-culture').attr('currentvalue'));
        $('#btn-setting-site-submit').click(function () {
            $.ajax({
                type: "POST",
                url: adminSettingSitePostUrl,
                data: $("#form-setting-site").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*设置站点*/
var SettingSitePage = function () {

};
/*修改密码*/
var ModifyPasswordPageTabs = function (th) {
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = ChangePasswordPageUrl;
    var content = CreatePanelElement(panelId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        $('#btn-modify-password-submit').click(function () {
            if (!$('#form-modify-password').form('validate')) {
                return;
            }
            $.ajax({
                type: "POST",
                url: ChangePasswordPostUrl,
                data: $("#form-modify-password").serialize(),
                success: function (msg) {
                    AjaxMessage(msg);
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*Tabs*/

/*公司简介*/
var SettingCommanyTabs = function (th) {
    var self;
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingAboutPageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingCommpanyPostUrl = "/admin/setting/commany";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        var cultureCombobox = $('#setting-commpany-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-commany').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingCommpanyPostUrl = "/admin/setting/commany/" + record.id;

            }
        });
        $('#form-setting-commany').form({ onBeforeLoad: function () { }, onLoadSuccess: function () {
            self.html('#setting-commany');
        }
        });
        var editor = window.KindEditor.create('#create-news-content', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                self = this;

            }
        });
        $('#setting-commany-culture').combobox("setValue", $('#setting-commany-culture').attr('currentvalue'));
        $('#btn-setting-commany-submit').click(function () {
            self.sync();
            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-commany").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*关于我们*/
var SettingAboutTabs = function (th) {
    var self;
    var selfAbout;
    var selfcompanyProfile;
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingAboutPageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingCommpanyPostUrl = "/admin/setting/about";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        var cultureCombobox = $('#setting-about-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-about').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingCommpanyPostUrl = "/admin/setting/about/" + record.id;

            }
        });
        $('#form-setting-about').form({ onBeforeLoad: function () { }, onLoadSuccess: function () {
            selfAbout.html($('#setting-about').val());
            selfcompanyProfile.html($('#setting-companyProfile').val());
        }
        });
        var editor = window.KindEditor.create('#setting-about', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                selfAbout = this;

            }
        });
        var editor1 = window.KindEditor.create('#setting-companyProfile', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                selfcompanyProfile = this;

            }
        });
        $('#setting-about-culture').combobox("setValue", $('#setting-about-culture').attr('currentvalue'));
        $('#btn-setting-about-submit').click(function () {
            selfAbout.sync();
            selfcompanyProfile.sync();

            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-about").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*联系我们*/
var SettingContactUsTabs = function (th) {
    var self;
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingContactUsPageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingCommpanyPostUrl = "/admin/setting/contactus";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        var cultureCombobox = $('#setting-contactus-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-contactus').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingCommpanyPostUrl = "/admin/setting/contactus/" + record.id;
                self.html($('#setting-contactus').val());

            }
        });
        $('#form-setting-contactus').form({ onBeforeLoad: function () { }, onLoadSuccess: function () {
            self.html($('#setting-contactus').val());
        }
        });
        var editor = window.KindEditor.create('#setting-contactus', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                self = this;

            }
        });
        $('#setting-contactus-culture').combobox("setValue", $('#setting-contactus-culture').attr('currentvalue'));
        $('#btn-setting-contactus-submit').click(function () {
            self.sync();
            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-contactus").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*营销网络*/
var SettingSalesNetworkTabs = function (th) {
    var self;
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingSalesNetworkPageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingCommpanyPostUrl = "/admin/setting/salesnetwork";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        var cultureCombobox = $('#setting-salesnetwork-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-salesnetwork').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingCommpanyPostUrl = "/admin/setting/salesnetwork/" + record.id;
                self.html($('#setting-salesnetwork').val());
            }
        });
        $('#form-setting-salesnetwork').form({ onBeforeLoad: function () { }, onLoadSuccess: function () {
            self.html($('#setting-salesnetwork').val());
        }
        });
        var editor = window.KindEditor.create('#setting-salesnetwork', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                self = this;

            }
        });
        $('#setting-salesnetwork-culture').combobox("setValue", $('#setting-salesnetwork-culture').attr('currentvalue'));
        $('#btn-setting-salesnetwork-submit').click(function () {
            self.sync();
            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-salesnetwork").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/*视频管理*/
var SettingVideoTabs = function (th) {
    var self;
    var title = $(th).attr('title');
    var panelId = $(th).attr('id') + '-panel';
    var panelUrl = SettingVideoPageUrl + '?culture=' + CurrentCulture;
    var content = CreatePanelElement(panelId, title);
    var adminSettingCommpanyPostUrl = "/admin/setting/video";
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var panelOption = $.extend(PanelDefaultOption, { href: panelUrl, cache: false, onLoad: function () {
        var cultureCombobox = $('#setting-video-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-video').form('load', SettingJsonUrl + '/' + record.id);
                adminSettingCommpanyPostUrl = "/admin/setting/video/" + record.id;
                self.html($('#setting-video').val());
            }
        });
        $('#form-setting-video').form({ onBeforeLoad: function () { }, onLoadSuccess: function () {
            self.html($('#setting-video').val());
        }
        });
        var editor = window.KindEditor.create('#setting-video', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                self = this;

            }
        });
        $('#setting-video-culture').combobox("setValue", $('#setting-video-culture').attr('currentvalue'));
        $('#btn-setting-video-submit').click(function () {
            self.sync();
            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-video").serialize(),
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    }
    });
    var sitePanel = $('#' + panelId).panel(panelOption);
};
/**/
var NewsTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Article/GetNewsJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: newsColmns, onLoadSuccess: function () {
        $("a[name='fancybox-news']").fancybox({
            'transitionIn': 'none',
            'transitionOut': 'none',
            'titlePosition': 'over'

        });
        $("span[name='jqeasyui-datagrid-news-edit']").click(function () {
            NewsEditWindows($(this).attr('value'), newsTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            NewsCreateWindows(newsTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(newsTable, "/admin/Article/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {
            NewsSearchWindows(newsTable);
        }
    }]
    });
    var newsTable = $("#" + tableId).datagrid(tableOption);
    NewsTable = newsTable;
};

var TechnologyConsultingTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Article/GetTechnologyConsultingJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: technologyconsultingColmns, onLoadSuccess: function () {
        $("a[name='fancybox-technologyconsulting']").fancybox({
            'transitionIn': 'none',
            'transitionOut': 'none',
            'titlePosition': 'over'

        });
        $("span[name='jqeasyui-datagrid-technologyconsulting-edit']").click(function () {
            TechnologyConsultingEditWindows($(this).attr('value'), technologyconsultingTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            TechnologyConsultingCreateWindows(technologyconsultingTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(technologyconsultingTable, "/admin/Article/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {
            TechnologyConsultingSearchWindows(technologyconsultingTable);
        }
    }]
    });
    var technologyconsultingTable = $("#" + tableId).datagrid(tableOption);
    TechnologyConsultingTable = technologyconsultingTable;
};

var ProductTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/product/GetListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: productColumns, onLoadSuccess: function () {
        $("a[name='fancybox-product']").fancybox({
            'transitionIn': 'none',
            'transitionOut': 'none',
            'titlePosition': 'over'

        });
        $("span[name='jqeasyui-datagrid-product-edit']").click(function () {
            ProductEditWindows($(this).attr('value'), productTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            ProductCreateWindows(productTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(productTable, "/admin/product/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {
            ProductSearchWindows(productTable);
        }
    }]
    });
    var productTable = $("#" + tableId).datagrid(tableOption);
    ProductTable = productTable;
};

var RecruitmentTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Recruitment/GetListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: recruitmentColumns, onLoadSuccess: function () {

        $("span[name='jqeasyui-datagrid-recruitment-edit']").click(function () {
            RecruitmentEditWindows($(this).attr('value'), recruitmentTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            RecruitmentCreateWindow(recruitmentTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(recruitmentTable, "/admin/Recruitment/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {

        }
    }]
    });
    var recruitmentTable = $("#" + tableId).datagrid(tableOption);
    RecruitmentTable = recruitmentTable;
};

var LinkTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Link/GetListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: linkColumns, onLoadSuccess: function () {
        $("a[name='fancybox-link']").fancybox({
            'transitionIn': 'none',
            'transitionOut': 'none',
            'titlePosition': 'over'

        });
        $("span[name='jqeasyui-datagrid-link-edit']").click(function () {
            LinkEditWindows($(this).attr('value'), linkTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            LinkCreateWindows(linkTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(linkTable, "/admin/Link/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {

        }
    }]
    });
    var linkTable = $("#" + tableId).datagrid(tableOption);
    LinkTable = linkTable;
};

var CandidatesTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Candidates/GetListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: candidatesColumns, onLoadSuccess: function () {

        $("span[name='jqeasyui-datagrid-candidates-view']").click(function () {
            CandidatesDetailsWindows($(this).attr('value'), candidatesTable);
        });
    }, toolbar: [{
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(candidatesTable, "/admin/Candidates/delete");
        }
    }]
    });
    var candidatesTable = $("#" + tableId).datagrid(tableOption);
    CandidatesTable = candidatesTable;
};

var CategoryTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Category/GetListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: categoryColumns, onLoadSuccess: function () {

        $("span[name='jqeasyui-datagrid-category-edit']").click(function () {
            CategoryEditWindows($(this).attr('value'), categoryTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            CategoryCreateWindows(categoryTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(categoryTable, "/admin/Category/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {
            CategorySearchWindows(categoryTable);
        }
    }]
    });
    var categoryTable = $("#" + tableId).datagrid(tableOption);
    CategoryTable = categoryTable;
};

var CategoryProductTabs = function (th) {
    var title = $(th).attr('title');
    var tableId = $(th).attr('id') + '-table-list';
    var tableUrl = "/Admin/Category/GetProductCategoryListJson";
    var content = CreatTableElement(tableId, title);
    var tab = addTab($(th).attr('id'), title, $(th).attr('url'), content, false, true);
    var tableOption = $.extend(tableOptionDefault, { url: tableUrl, columns: categoryProductColumns, onLoadSuccess: function () {

        $("span[name='jqeasyui-datagrid-category-product-edit']").click(function () {
            CategoryProductEditWindows($(this).attr('value'), productCategoryTable);
        });
    }, toolbar: [{
        text: '添加',
        iconCls: 'icon-add',
        handler: function () {
            CategoryProductCreateWindows(productCategoryTable);
        }
    }, '-', {
        text: '删除',
        iconCls: 'icon-remove',
        handler: function () {
            TableDeleteRecord(productCategoryTable, "/admin/Category/delete");
        }
    }, '-', {
        text: '查询',
        iconCls: 'icon-search',
        handler: function () {

        }
    }]
    });
    var productCategoryTable = $("#" + tableId).datagrid(tableOption);
    ProductCategoryTable = productCategoryTable;
};

var ProductTable;
var NewsTable;
var TechnologyConsultingTable;
var LinkTable;
var CategoryTable;
var ProductCategoryTable;
var RecruitmentTable;
var CandidatesTable;

/*windows */
var ProductCreateWindows = function (table) {
    var self;
    var selfEn;
    $("#win-create-product").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/product/Create",
        onLoad: function () {
            var editor = window.KindEditor.create('#create-produc-description', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '/admin/product/UploadFileProductJson',
                fileManagerJson: '/admin/product/FileManagerProductJson',
                allowFileManager: true, afterCreate: function () {
                    self = this;

                }
            });
            var editorEn = window.KindEditor.create('#create-produc-descriptionen', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '/admin/product/UploadFileProductJson',
                fileManagerJson: '/admin/product/FileManagerProductJson',
                allowFileManager: true, afterCreate: function () {
                    selfEn = this;

                }
            });
            $('#create-product-categoryid').combobox({
                url: '/admin/Category/GetProductComboBoxJson',
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-create-product-submit').click(function () {
                self.sync(); selfEn.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/product/create",
                    data: $("#create-product-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });
            var uploadproductimage = function () {
                $.ajaxFileUpload({
                    url: '/admin/Attachment/UploadProductImage',
                    secureuri: false,
                    fileElementId: 'create-product-productimage',
                    dataType: 'json',
                    data: { path: '/Upload/Product/', belongsId: '', belongsType: '' },
                    success: function (data, status) {
                        if (typeof (data.state) != 'undefined') {
                            if (data.state) {
                                $('#create-product-productimage').hide();
                                $('#create-product-productimage').after('<a name="fancybox-create-product-productimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + data.filerelativepath + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + data.filename + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-create-product-productimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
                                $("a[name='fancybox-create-product-productimage']").fancybox({
                                    'transitionIn': 'none',
                                    'transitionOut': 'none',
                                    'titlePosition': 'over'
                                });
                                $('#create-product-normalimage').val(data.imagerelativepath); $('#create-product-smallimage').val(data.thumimagerelativepath);
                                $('#delete-create-product-productimage').click(function () {
                                    DeleteProductImage(data.imageid);
                                    $("a[name='fancybox-create-product-productimage']").remove();
                                    $("#delete-create-product-productimage").remove();
                                    $('#create-product-productimage').show();
                                    $('#create-product-normalimage').val('');
                                    $('#create-product-smallimage').val('');


                                });

                            } else {
                                $.messager.alert('错误', data.message, "error");
                            }

                        }
                    },
                    complete: function () {
                        $('#create-product-productimage').val('');
                        $('#create-product-productimage').bind('change', uploadproductimage);
                    }
                });

            };
            $('#create-product-productimage').bind('change', uploadproductimage);
        }
    });
};
var ProductEditWindows = function (id, table) {
    var self;
    var selfEn;
    $("#win-edit-product").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/Product/Edit?id=" + id,
        onLoad: function () {
            var editor = window.KindEditor.create('#edit-product-description', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '/admin/product/UploadFileProductJson',
                fileManagerJson: '/admin/product/FileManagerProductJson',
                allowFileManager: true, afterCreate: function () {
                    self = this;

                }
            });
            var editorEn = window.KindEditor.create('#edit-product-descriptionen', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '/admin/product/UploadFileProductJson',
                fileManagerJson: '/admin/product/FileManagerProductJson',
                allowFileManager: true, afterCreate: function () {
                    selfEn = this;

                }
            });
            $('#edit-product-categoryid').combobox({
                url: '/admin/Category/GetProductComboBoxJson?value=' + $("#edit-product-categoryid").attr('categoryvalue'),
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-edit-produt-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/product/edit",
                    data: $("#edit-product-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });
            $('#edit-product-productimage').hide();
            $('#edit-product-productimage').after('<a name="fancybox-edit-product-productimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + $('#edit-product-normalimage').val() + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + '' + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-edit-product-productimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
            $("a[name='fancybox-edit-product-productimage']").fancybox({
                'transitionIn': 'none',
                'transitionOut': 'none',
                'titlePosition': 'over'
            });

            $('#delete-edit-product-productimage').click(function () {
                $("a[name='fancybox-edit-product-productimage']").remove();
                $("#delete-edit-product-productimage").remove();
                $('#edit-product-productimage').show();
                $('#edit-product-normalimage').val('');
                $('#edit-product-smallimage').val('');

            });
            var uploadproductimage = function () {
                $.ajaxFileUpload({
                    url: '/admin/Attachment/UploadProductImage',
                    secureuri: false,
                    fileElementId: 'edit-product-productimage',
                    dataType: 'json',
                    data: { path: '/Upload/Product/', belongsId: '', belongsType: '' },
                    success: function (data, status) {
                        if (typeof (data.state) != 'undefined') {
                            if (data.state) {
                                $('#edit-product-productimage').hide();
                                $('#edit-product-productimage').after('<a name="fancybox-edit-product-productimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + data.filerelativepath + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + data.filename + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-edit-product-productimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
                                $("a[name='fancybox-edit-product-productimage']").fancybox({
                                    'transitionIn': 'none',
                                    'transitionOut': 'none',
                                    'titlePosition': 'over'
                                });
                                $('#edit-product-normalimage').val(data.imagerelativepath); $('#edit-product-smallimage').val(data.thumimagerelativepath);
                                $('#delete-edit-product-productimage').click(function () {
                                    DeleteProductImage(data.imageid);
                                    $("a[name='fancybox-edit-product-productimage']").remove();
                                    $("#delete-edit-product-productimage").remove();
                                    $('#edit-product-productimage').show();
                                    $('#edit-product-normalimage').val('');
                                    $('#edit-product-smallimage').val('');


                                });

                            } else {
                                $.messager.alert('错误', data.message, "error");
                            }

                        }
                    },
                    complete: function () {
                        $('#edit-product-productimage').val('');
                        $('#edit-product-productimage').bind('change', uploadproductimage);
                    }
                });

            };
            $('#edit-product-productimage').bind('change', uploadproductimage);
        }
    });

};
var ProductSearchWindows = function (table) {
    $("#win-search-product").window({
        modal: false,
        width: 500,
        height: 300,
        cache: true,
        href: "/admin/Product/SearchControl",
        onLoad: function () {
            $('#search-product-categoryid').combobox({
                url: '/admin/Category/GetProductComboBoxJson',
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-search-product-submit').click(function () {

                table.datagrid("reload", $('#search-product-form').serializeObject());
                table.datagrid('clearSelections');
            });

        }
    });
};
var ProductImageUploadWindows = function (table) {
};
var ProductImageManageWindows = function (table) {
};



var AdvertisementCreateWindow = function (table) {
    var self;
    $("#win-create-advertisement").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/advertisement/Create",
        onLoad: function () {
            $('#btn-create-advertisement-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/advertisement/create",
                    data: $("#create-advertisement-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });

        }
    });

};
var AdvertisementEditWindows = function (id, table) {
    var self;
    $("#win-edit-advertisement").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/advertisement/Edit?id=" + id,
        onLoad: function () {
            $('#btn-edit-advertisement-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/advertisement/edit",
                    data: $("#edit-advertisement-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var AdvertisementSearchWindows = function (table) {
};

var RecruitmentCreateWindow = function (table) {

    $("#win-create-recruitment").window({
        modal: false,
        width: 800,
        height: 500,
        cache: false,
        href: "/admin/recruitment/Create",
        onLoad: function () {
            $('#btn-create-recruitment-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/recruitment/create",
                    data: $("#create-recruitment-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });

        }
    });
};
var RecruitmentEditWindows = function (id, table) {

    $("#win-edit-recruitment").window({
        modal: false,
        width: 800,
        height: 500,
        cache: false,
        href: "/admin/recruitment/Edit?id=" + id,
        onLoad: function () {
            $('#btn-edit-recruitment-sumbit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/recruitment/edit",
                    data: $("#edit-recruitment-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var RecruitmentSearchWindows = function (table) {
};

var CandidatesDetailsWindows = function (id, table) {

    $("#win-details-candidates").window({
        modal: false,
        width: 700,
        height: 500,
        cache: false,
        href: "/admin/candidates/details?id=" + id,
        onLoad: function () {
            $('#btn-read-candidates-submit').click(function () {
                $.ajax({
                    type: "POST",
                    url: "/admin/Candidates/Read",
                    data: { id: $('#candidates-read-id').val() },
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var CandidatesCreateWindows = function (table) {
    var self;
    $("#win-create-link").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/link/Create",
        onLoad: function () {
            $('#btn-create-link-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/link/create",
                    data: $("#create-link-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });

        }
    });
};
var CandidatesEditWindows = function (id, table) {
    var self;
    $("#win-edit-link").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/link/Edit?id=" + id,
        onLoad: function () {
            $('#btn-edit-link-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/link/edit",
                    data: $("#edit-link-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var CandidatesSearchWindows = function (table) {
};

var LinkCreateWindows = function (table) {

    $("#win-create-link").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/link/Create",
        onLoad: function () {
            $('#btn-create-link-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/link/create",
                    data: $("#create-link-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });
            var uploadlinkimage = function () {
                $.ajaxFileUpload({
                    url: '/admin/Attachment/UploadLinkImage',
                    secureuri: false,
                    fileElementId: 'create-link-linkimage',
                    dataType: 'json',
                    data: { path: '/Upload/Link/', belongsId: '', belongsType: '' },
                    success: function (data, status) {
                        if (typeof (data.state) != 'undefined') {
                            if (data.state) {
                                $('#create-link-linkimage').hide();
                                $('#create-link-linkimage').after('<a name="fancybox-create-link-linkimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + data.filerelativepath + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + data.filename + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-create-link-linkimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
                                $("a[name='fancybox-create-link-linkimage']").fancybox({
                                    'transitionIn': 'none',
                                    'transitionOut': 'none',
                                    'titlePosition': 'over'
                                });
                                $('#create-link-image').val(data.imagerelativepath);
                                $('#delete-create-link-linkimage').click(function () {
                                    DeleteProductImage(data.imageid);
                                    $("a[name='fancybox-create-link-linkimage']").remove();
                                    $("#delete-create-link-linkimage").remove();
                                    $('#create-link-linkimage').show();
                                    $('#create-link-image').val('');



                                });

                            } else {
                                $.messager.alert('错误', data.message, "error");
                            }

                        }
                    },
                    complete: function () {
                        $('create-link-linkimage').val('');
                        $('#create-link-linkimage').bind('change', uploadlinkimage);
                    }
                });

            };
            $('#create-link-linkimage').bind('change', uploadlinkimage);
        }
    });
};
var LinkEditWindows = function (id, table) {

    $("#win-edit-link").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/link/Edit?id=" + id,
        onLoad: function () {
            $('#btn-edit-link-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/link/edit",
                    data: $("#edit-link-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });
            $('#edit-link-linkimage').hide();
            $('#edit-link-linkimage').after('<a name="fancybox-edit-link-linkimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + $('#edit-link-image').val() + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + '' + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-edit-link-linkimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
            $("a[name='fancybox-edit-link-linkimage']").fancybox({
                'transitionIn': 'none',
                'transitionOut': 'none',
                'titlePosition': 'over'
            });
            $('#delete-edit-link-linkimage').click(function () {
                $("a[name='fancybox-edit-link-linkimage']").remove();
                $("#delete-edit-link-linkimage").remove();
                $('#edit-link-linkimage').show();
                $('#edit-link-image').val('');
            });
            var uploadlinkimage = function () {
                $.ajaxFileUpload({
                    url: '/admin/Attachment/UploadLinkImage',
                    secureuri: false,
                    fileElementId: 'edit-link-linkimage',
                    dataType: 'json',
                    data: { path: '/Upload/Link/', belongsId: '', belongsType: '' },
                    success: function (data, status) {
                        if (typeof (data.state) != 'undefined') {
                            if (data.state) {
                                $('#edit-link-linkimage').hide();
                                $('#edit-link-linkimage').after('<a name="fancybox-edit-link-linkimage"  style="padding: 0px;margin:0px 12px 0px 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + data.filerelativepath + '"><img style="padding: 0px;margin-top: 5px ;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + data.filename + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a><a href="#" id="delete-edit-link-linkimage" style="padding: 0px; margin: 0px; border: 0px none; text-align: center; height: 16px; width: 16px; line-height: 20px;" >删除</a>');
                                $("a[name='fancybox-edit-link-linkimage']").fancybox({
                                    'transitionIn': 'none',
                                    'transitionOut': 'none',
                                    'titlePosition': 'over'
                                });
                                $('#edit-link-image').val(data.imagerelativepath);
                                $('#delete-edit-link-linkimage').click(function () {
                                    DeleteProductImage(data.imageid);
                                    $("a[name='fancybox-edit-link-linkimage']").remove();
                                    $("#delete-edit-link-linkimage").remove();
                                    $('#edit-link-linkimage').show();
                                    $('#edit-link-image').val('');

                                });

                            } else {
                                $.messager.alert('错误', data.message, "error");
                            }

                        }
                    },
                    complete: function () {
                        $('edit-link-linkimage').val('');
                        $('#edit-link-linkimage').bind('change', uploadlinkimage);
                    }
                });

            };
            $('#edit-link-linkimage').bind('change', uploadlinkimage);
        }
    });
};
var LinkSearchWindows = function (table) {
};

var OrderCreateWindows = function (table) {
};
var OrderEditWindows = function (id, table) {
};
var OrderSearchWindows = function (table) {
};

var NewsCreateWindows = function (table) {
    var self;
    $("#win-create-news").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/Article/CreateNewsControl",
        onLoad: function () {
            var editor = window.KindEditor.create('#create-news-content', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '',
                fileManagerJson: '',
                allowFileManager: true, afterCreate: function () {
                    self = this;

                }
            });
            $('#create-news-createtime').datetimebox({
                showSeconds: false
            });
            $('#create-news-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-create-news-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/article/create",
                    data: $("#create-news-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });

        }
    });
};
var NewsEditWindows = function (id, table) {
    var self;
    $("#win-edit-news").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/Article/EditNewsControl?id=" + id,
        onLoad: function () {
            var editor = window.KindEditor.create('#edit-news-content', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '',
                fileManagerJson: '',
                allowFileManager: true, afteredit: function () {
                    self = this;

                }
            });
            $('#edit-news-edittime').datetimebox({
                showSeconds: false
            });
            $('#edit-news-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#edit-news-culture').combobox("setValue", $("#edit-news-culture").attr('culturevalue'));
            $('#btn-edit-news-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/article/edit",
                    data: $("#edit-news-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var NewsSearchWindows = function (table) {
    $("#win-search-news").window({
        modal: false,
        width: 500,
        height: 300,
        cache: true,
        href: "/admin/article/SearchNewsControl",
        onLoad: function () {
            $('#search-news-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-search-news-submit').click(function () {

                table.datagrid("reload", $('#search-news-form').serializeObject());
                table.datagrid('clearSelections');
            });

        }
    });
};


var TechnologyConsultingCreateWindows = function (table) {
    var self;
    $("#win-create-technologyconsulting").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/Article/CreateTechnologyConsultingControl",
        onLoad: function () {
            var editor = window.KindEditor.create('#create-technologyconsulting-content', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '',
                fileManagerJson: '',
                allowFileManager: true, afterCreate: function () {
                    self = this;

                }
            });
            $('#create-technologyconsulting-createtime').datetimebox({
                showSeconds: false
            });
            $('#create-technologyconsulting-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-create-technologyconsulting-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/article/create",
                    data: $("#create-technologyconsulting-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });

        }
    });
};
var TechnologyConsultingEditWindows = function (id, table) {
    var self;
    $("#win-edit-technologyconsulting").window({
        modal: false,
        width: 1000,
        height: 500,
        cache: false,
        href: "/admin/Article/EditTechnologyConsultingControl?id=" + id,
        onLoad: function () {
            var editor = window.KindEditor.create('#edit-technologyconsulting-content', {
                cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '',
                fileManagerJson: '',
                allowFileManager: true,
                afterCreate: function () {
                    self = this;

                }
            });
            $('#edit-technologyconsulting-edittime').datetimebox({
                showSeconds: false
            });
            $('#edit-technologyconsulting-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#edit-technologyconsulting-culture').combobox("setValue", $("#edit-technologyconsulting-culture").attr('culturevalue'));

            $('#btn-edit-technologyconsulting-submit').click(function () {
                self.sync();
                $.ajax({
                    type: "POST",
                    url: "/admin/article/edit",
                    data: $("#edit-technologyconsulting-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });

        }
    });
};
var TechnologyConsultingSearchWindows = function (table) {
    $("#win-search-technologyconsulting").window({
        modal: false,
        width: 500,
        height: 300,
        cache: true,
        href: "/admin/article/SearchTechnologyConsultingControl",
        onLoad: function () {
            $('#search-technologyconsulting-culture').combobox({
                data: CultureComboboxJsonData,
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-search-technologyconsulting-submit').click(function () {
                table.datagrid("reload", $('#search-technologyconsulting-form').serializeObject());
                table.datagrid('clearSelections');
            });

        }
    });
};

var CategoryCreateWindows = function (table) {

    $("#win-create-category").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/category/Create",
        onLoad: function () {
            $('#btn-create-category-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/category/create",
                    data: $("#create-category-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                        if (msg.state) LoadProductCategoryData();

                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });
            $('#create-category-type').combobox({
                data: CategoryTypeData,
                valueField: 'id',
                textField: 'text'
            });

        }
    });
};
var CategoryEditWindows = function (id, table) {
    $("#win-edit-category").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/category/Edit?id=" + id,
        onLoad: function () {
            $('#btn-edit-category-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/category/edit",
                    data: $("#edit-category-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                        if (msg.state) LoadProductCategoryData();
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });
            });
            $('#edit-category-type').combobox({
                data: CategoryTypeData,
                valueField: 'id',
                textField: 'text'
            });
            $('#edit-category-type').combobox("setValue", $('#edit-category-type').attr('typevalue'));

        }
    });
};
var CategorySearchWindows = function (table) {
    $("#win-search-category").window({
        modal: false,
        width: 500,
        height: 300,
        cache: true,
        href: "/admin/Category/SearchControl",
        onLoad: function () {
            $('#search-category-type').combobox({
                data: CategoryTypeData,
                valueField: 'id',
                textField: 'text'
            });
            $('#btn-search-category-submit').click(function () {
                table.datagrid("reload", $('#search-category-form').serializeObject());
                table.datagrid('clearSelections');
            });

        }
    });
};
var CategoryProductCreateWindows = function (table) {

    $("#win-create-product-category").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/category/CreateProductCategoryControl",
        onLoad: function () {
            $('#btn-create-product-category-submit').click(function () {

                $.ajax({
                    type: "POST",
                    url: "/admin/category/create",
                    data: $("#create-product-category-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '添加失败！', "error");
                    }
                });
            });
        }
    });
};
var CategoryProductEditWindows = function (id, table) {

    $("#win-edit-product-category").window({
        modal: false,
        width: 500,
        height: 350,
        cache: false,
        href: "/admin/category/EditProductCategoryControl?id=" + id,
        onLoad: function () {
            $('#btn-edit-product-category-submit').click(function () {
                $.ajax({
                    type: "POST",
                    url: "/admin/category/edit",
                    data: $("#edit-product-category-form").serialize(),
                    success: function (msg) {
                        AjaxMessage(msg);
                        if (msg.state)
                            if (table != undefined)
                                table.datagrid("reload");
                    },
                    error: function () {
                        $.messager.alert('错误', '修改失败！', "error");
                    }
                });

            });

        }
    });
};
var CategoryProductSearchWindows = function (table) {
};

/*定义 table 列 属性*/
var newsColmns =
    [[
    { field: 'Id', checkbox: true },
    { field: 'MainTitle', title: '标题', align: 'center', width: 150 }, {
        field: 'Culture',
        title: '语言',
        width: 80,
        align: 'center', sortable: true,
        formatter: function (value, rec) {
            for (var i = 0; i < CultureComboboxJsonData.length; i++) {
                if (CultureComboboxJsonData[i].id == value) return CultureComboboxJsonData[i].text;
            }
            return "";

        }
    },
    { field: 'CreateTime', title: '时间', align: 'center', width: 120, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    {
        field: 'NormalImage',
        title: '图片',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-news" class="fancybox-news" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.NormalImage + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a>';
            ;
        }
    },
    {
        field: 'SmallImage',
        title: '图片(小)',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-news" class="fancybox-news" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.SmallImage + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a>';
            ;
        }
    },
    {
        field: 'OptEdit',
        title: '修改',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-news-edit" value=' + rowData.Id + '>修改</span>';
            ;
        }
    }
]];
var technologyconsultingColmns = [[
    { field: 'Id', checkbox: true },
    { field: 'MainTitle', title: '标题', align: 'center', width: 150 },
    {
        field: 'Culture',
        title: '语言',
        width: 80,
        align: 'center', sortable: true,
        formatter: function (value, rec) {
            for (var i = 0; i < CultureComboboxJsonData.length; i++) {
                if (CultureComboboxJsonData[i].id == value) return CultureComboboxJsonData[i].text;
            }
            return "";

        }
    },
    { field: 'CreateTime', title: '时间', align: 'center', width: 120, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    { field: 'OptEdit', title: '修改', width: 40, align: 'center', formatter: function (value, rowData, rec) {
        return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-technologyconsulting-edit" value=' + rowData.Id + '>修改</span>';
        ;
    }
    }
]];
var productColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '名称', width: 150, align: 'center' },
    { field: 'NameEn', title: '名称(EN)', width: 150, align: 'center' },
    { field: 'Model', title: '型号', width: 120, align: 'center' },
    { field: 'Sort', title: '排序', width: 40, align: 'center', sortable: true },
    {
        field: 'CategoryId',
        title: '产品类型',
        width: 80,
        align: 'center', sortable: true,
        formatter: function (value, rec) {
            for (var i = 0; i < ProductCategoryData.length; i++) {
                if (ProductCategoryData[i].id == value) return ProductCategoryData[i].text;
            }
            return "";

        }
    },
    {
        field: 'IsRecommend',
        title: '推荐',
        width: 30,
        align: 'center',
        formatter: function (value, rec) {

            return value ? '是' : '否';
        }
    },
    {
        field: 'NormalImage',
        title: '图片',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-product" ref="fancybox-product" class="fancybox-product" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.NormalImage + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a>';
            ;
        }
    },
    {
        field: 'SmallImage',
        title: '图片(小)',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-product" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.SmallImage + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a>';
            ;
        }
    },
    {
        field: 'OptEdit',
        title: '修改',
        width: 30,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit-product" name="jqeasyui-datagrid-product-edit" value=' + rowData.Id + '>修改</span>';
            ;
        }
    }
]];
var linkColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '名称', width: 120, align: 'center' },
    { field: 'Sort', title: '排序', align: 'center', width: 30, sortable: true, editor: { type: 'numberbox', options: { precision: 1}} },
    {
        field: 'Image',
        title: '图片',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-link" class="fancybox-link" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.Image + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/Images/easyicon_cn_32.png" /></a>';
            ;
        }
    },
    {
        field: 'IsClosed',
        title: '停用',
        width: 80, align: 'center',
        editor: { type: 'checkbox', options: { on: 'true', off: 'false'} },
        formatter: function (value, rec) {

            return value ? '是' : '否';
        }
    },
    {
        field: 'OptEdit',
        title: '修改',
        width: 80,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-link-edit" value=' + rowData.Id + '>修改</span>';
            ;
        }
    }
]];
var categoryColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '名称', width: 120, align: 'center' },
    { field: 'NameEn', title: '名称(EN)', width: 120, align: 'center' },
    {
        field: 'Type',
        title: '所属',
        width: 80,
        sortable: true,
        formatter: function (value, rec) {
            for (var i = 0; i < CategoryTypeData.length; i++) {
                if (CategoryTypeData[i].id == value) return CategoryTypeData[i].text;
            }
            return "";

        }
    },
    { field: 'Sort', title: '排序', width: 30, sortable: true, align: 'center' },
    { field: 'CreateTime', align: 'center', title: '时间', width: 120, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    {
        field: 'OptEdit',
        title: '修改',
        width: 40, align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-category-edit" value=' + rowData.Id + '>修改</span>';
            ;
        }
    }
]];
var categoryProductColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '名称', width: 120, align: 'center' },
    { field: 'NameEn', title: '名称(EN)', width: 120, align: 'center' },
    { field: 'Sort', title: '排序', width: 30, sortable: true, align: 'center' },
    { field: 'CreateTime', align: 'center', title: '时间', width: 120, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    {
        field: 'OptEdit',
        title: '修改',
        width: 40, align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-category-product-edit"  value=' + rowData.Id + '>修改</span>';
        }
    }
]];
var recruitmentColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '职位', width: 120, align: 'center' },
    { field: 'WorkExperience', title: '工作经验', width: 80, align: 'center' },
    { field: 'MonthlySalaryRange', title: '月薪范围', width: 80, align: 'center' },
    { field: 'Sex', title: '性别', width: 80, align: 'center' },
    { field: 'CreateTime', title: '发布日期', align: 'center', width: 120, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    {
        field: 'OptEdit',
        title: '修改',
        width: 80,
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-recruitment-edit" value=' + rowData.Id + '>修改</span>';
            ;
        }
    }
]];
var candidatesColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '姓名', width: 120, align: 'center' },
    { field: 'Sex', title: '性别', width: 40, align: 'center' },
    {
        field: 'IsRead',
        title: '已阅',
        width: 20, align: 'center', sortable: true,
        formatter: function (value, rec) {
            return value ? '是' : '否';
        }
    },
    { field: 'PostName', title: '岗位', width: 120, align: 'center' },
    { field: 'CreateTime', align: 'center', title: '时间', width: 120, sortable: true, formatter: function (value, rec) { return eval("new " + value.substr(1, value.length - 2)).toLocaleDateString(); } },
    {
        field: 'OptView',
        title: '查看',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-view" name="jqeasyui-datagrid-candidates-view" value=' + rowData.Id + '>查看</span>';
            ;
        }
    }
]];
var advertismentColumns = [[
    { field: 'Id', checkbox: true },
    { field: 'Name', title: '名称', width: 120, align: 'center' },
    { field: 'Sort', title: '排序', align: 'center', width: 80, sortable: true, editor: { type: 'numberbox', options: { precision: 1}} },
    {
        field: 'Url',
        title: '图片',
        width: 40,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<a name="fancybox-link" style="padding: 0px;margin: 0px;border:0px none;text-align: center;height:16px;width:16px;" href="' + rowData.Url + '"><img style="padding: 0px;margin: 0px;border:0px none;text-align: center;color:#fff;height:16px;width:16px;" alt="' + rowData.Name + '" src="/Content/Admin/image/easyicon_cn_32.png" /></a>';
        }
    },
    {
        field: 'IsClosed',
        title: '停用',
        width: 80,
        editor: { type: 'checkbox', options: { on: 'true', off: 'false'} },
        formatter: function (value, rec) {

            return value ? '是' : '否';
        }
    },
    {
        field: 'OptEdit',
        title: '修改',
        width: 80,
        align: 'center',
        formatter: function (value, rowData, rec) {
            return '<span style="color:red" class="jqeasyui-datagrid-edit" name="jqeasyui-datagrid-advertisment-edit" value=' + rowData.Id + '>修改</span>';
        }
    }
]];